package com.lsfb.signsys.editpwd;

import android.support.design.widget.Snackbar;
import android.widget.EditText;

import com.lsfb.signsys.BaseActivity;
import com.lsfb.signsys.R;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by zgscwjm on 2018/4/10.
 */

public class EditPwdActivity extends BaseActivity implements EditPwdContract.EditPwdView {


    private EditPwdContract.EditPwdPresenter mPresenter;

    @BindView(R.id.act_editpwd_oldpwd_et)
    EditText et_oldpwd;

    @BindView(R.id.act_editpwd_newpwd_et)
    EditText et_newpwd;


    @Override
    public int getContentView() {
        return R.layout.activity_editpwd;
    }

    @Override
    public void init() {
        new EditPwdPresenter(this);
    }

    @Override
    public void setPresenter(EditPwdContract.EditPwdPresenter persenter) {
        mPresenter = persenter;
    }

    @Override
    public void showMsg(String message) {
        Snackbar.make(getWindow().getDecorView(), message, Snackbar.LENGTH_INDEFINITE).show();
    }


    @OnClick(value = R.id.act_editpwd_btn_submit)
    public void editpwd() {
        mPresenter.editpwd(et_oldpwd.getText().toString(), et_newpwd.getText().toString());
    }
}
